<?php
$dbname="lilishop";
include("d:/collect_new/myzhuaqu.php");
include("jsondecode_inc.php");
$g=array();
$str=<<<TEXT
{
  "order":{
    "order_location":"TWH",
    "uniqueKey":"300301",
    "order_no":"300301",
    "order_type":"Prepaid",
    "payment_type":"Credit Card",
    "awbNo":"9876543",
    "status":"Confirmed",
    "hold_status":"no",
    "address_verified":"yes",
    "payment_verified":"yes",
    "address_type":"Office",
    "order_date":"14/12/2016 15:40:30",
    "shipby_date":"14/12/2016 15:40:30",
    "order_amount":"2000.00",
    "order_currency":"GBP",
    "conversion_rate":"1.41",
    "is_replacement":"no",
    "original_orderno":"",
    "is_replacement":"no",
    "customer_code":"999999",
    "extCustomerCode":"CUST01",
    "customer_name":"Anuj Kaul",
    "ship_address1":"House number 50, First Floor",
    "ship_address2":"ABC Road, Green Park",
    "ship_address3":"123",
    "ship_address4":"XYZ",
    "ship_city":"Mumbai",
    "ship_state":"Maharashtra",
    "ship_country":"India",
    "ship_pincode":"400001",
    "ship_phone1":"9999112233",
    "ship_phone2":"",
    "ship_email1":"anujkaul86@gmail.com",
    "ship_email2":"",
    "bill_name":"Anuj Kaul",
    "bill_address1":"House number 50, First Floor",
    "bill_address2":"ABC Road, Green Park",
    "bill_address3":"123",
    "bill_address4":"XYZ",
    "bill_city":"Mumbai",
    "bill_state":"Maharashtra",
    "landmark":"Sector-63",
    "latitude":"12.345675",
    "longitude":"23.123456",
    "url":"https://images.pexels.com/photos/814264/pexels-photo-814264.jpeg?auto=compress&cs=tinysrgb&h=350",
    "bill_country":"India",
    "bill_pincode":"400001",
    "bill_phone1":"9999112233",
    "bill_phone2":"",
    "bill_email1":"anujkaul86@gmail.com",
    "bill_email2":"",
    "order_remarks":"Please use bubble wrap",
    "shipping_charges":"99.00",
    "other_charge1":"20.00",
    "other_charge2":"",
    "store_credit":"50.00",
    "other_discount":"",
    "discount_code":"BEP10212",
    "cancel_remark":"",
    "is_giftwrap":"Yes",
    "giftwrap_msg":"Congratulations",
    "delivery_slot":"14:00-17:00",
    "udf1":"",
    "udf2":"",
    "udf3":"",
    "udf4":"",
    "udf5":"",
    "udf6":"",
    "udf7":"",
    "udf8":"",
    "udf9":"",
    "udf10":"",
    "custTinNo":"",
    "pickAfterDate":"",
    "giftwrapCharge":null,
    "gvAmount":null,
    "rewardPointsAmount":0,
    "cust_type":"B2B",
    "req_type":"",
    "pickupLocation":"",
    "handoverValCode":"",
    "geoType" :"What3WorDS",
    "geoAddress" :"101 add",
    "geoLatitude":"101 latitude",
    "geoLongitude":"101 longitude",
    "orderProcessing":"B2C",
    "items":[
    {
      "lineno":"1",
      "sku":"T04TAP0858-178",
      "channelSkuCode":"8196511",
      "channelProductId":"",
      "order_qty":"2",
      "cancelled_qty":"",
      "unit_price":"450.00",
      "bundle_sku":"T04TAP0858",
      "bundle_price":"500.00",
      "bundle_qty":"2",
      "mrp":"500.00",
      "discount_amt":"70.00",
      "gift_voucher_amt":"30.00",
      "shipping_charges":"99.00",
      "other_charge1":"20.00",
      "transporter":"12345",
      "store_credit":"50.00",
      "is_giftcard":"No",
      "vendor":"12345",
      "mode":"wms",
      "tax_inclusive":"YES",
      "tax_percentage":"5",
      "udf1":"",
      "udf2":"",
      "udf3":"",
      "udf4":"",
      "udf5":"",
      "udf6":"",
      "udf7":"",
      "udf8":"",
      "udf9":"",
      "udf10":"",
      "locationCode":"NWB",
      "delFulfillmentMode":"2",
      "shipmentType":"single",
      "shipby_date":"14/12/2016 15:15:30"
      }
      ],
     "paymentItems":[
      {
       "paymentMode":"Cash",
       "docNo":"",
       "docdate":"",
       "docBank":"Axis",
       "ifscCode":"",
       "docAmt":"100.00",
       "amountreceived":"",
       "branch":"",
       "authCode":"",
       "edcNo":"",
       "udf1":"",
       "udf2":"",
       "udf3":"",
       "udf4":"",
       "udf5":""
       }
     ]
  }
}
TEXT;
$description=<<<TEXT2
order_location Varchar（3）外部系统的条件eRetail位置代码或loccode。如果配置了单个位置代码，API将从订单API配置中选择位置代码。如果API映射到多个位置，则必须在请求中提供字段。
awbNo Varchar（50）可选跟踪号
uniqueKey Varchar（15）必填字段uniqueKey是标识特定订单的唯一标识符。它在通话中必须是唯一的
order_no Varchar（50）外部系统的强制订单号
order_type Varchar（50）强制要求，例如COD、预付费。主代码：ODRTYPE
payment_type Varchar（50）强制要求，例如信用卡、现金
status Varchar（50）强制，例如待定、已确认。主代码：ODRSTS
hold_status Varchar（3）可选，例如是，否
address_verified Varchar（3）可选，例如是，否
payment_verified Varchar（3）可选，例如是，否
address_type Varchar（2）可选可能值为Home、Office、Work和Other
order_date datetime通用信息部分给出的强制格式
shipby_date datetime通用信息部分中提供的可选格式
order_currency Varchar（10）强制要求，例如INR、USD
conversion_rate decimal（10,3）可选
is_replacement Varchar（3）可选是/否，用于将替换订单传递值创建为“是”
original_orderno Varchar（50）条件如果is_replacement=“是”，则该字段是必填字段
customer_code Varchar（20）可选 如果将提供客户代码，则将使用提供的客户代码创建订单，如果没有，则系统将考虑默认客户代码的订单。i、 e.999999年
extCustomerCode Varchar（20）可选 如果将提供外部客户代码，则将使用提供的外部客户代码创建订单
customer_name Varchar（100）强制要求
ship_address1 Varchar（1000）强制要求
ship_address2 Varchar（200）可选
ship_address3 Varchar（200）可选
ship_address4 Varchar（50）可选
ship_city Varchar（40）强制要求
ship_state Varchar（50）强制要求
ship_country Varchar（50）强制要求
ship_pincode Varchar（50）强制要求
ship_phone1 Varchar（20）强制要求
ship_phone2 Varchar（20）可选
ship_email1 Varchar（255）强制要求
ship_email2 Varchar（255）可选
bill_name Varchar（200）强制要求
bill_address1 Varchar（1000）强制要求
bill_address2 Varchar（200）可选
bill_address3 Varchar（200）可选
bill_address4 Varchar（50）可选
bill_city Varchar（40）强制要求
bill_state Varchar（50）强制要求
landmark Varchar（100）可选
latitude Varchar（100）可选纬度范围从-90到90，例如17.572375290155
longitude Varchar（100）可选经度范围从-180到80，例如-179.572375290155
url Varchar（300）可选
bill_country Varchar（50）强制要求
bill_pincode Varchar（50）强制要求
bill_phone1 Varchar（20）强制要求
bill_email1 Varchar（255）强制要求
bill_email2 Varchar（255）可选
order_remarks Varchar（100）可选
shipping_charges 十进制（10,3）可选
other_charge1 十进制（10,3）可选
other_charge2 十进制（10,3）可选
store_credit decimal（10,3）可选
other_discount decimal（10,3）可选此字段未在API中使用。保留以备将来使用
discount_code Varchar（30）可选
cancel_remark Varchar（255）可选
is_giftwrap Varchar（3）可选是/否
giftwrap_msg Varchar（500）可选
delivery_slot Varchar（11）可选，例如14:00-17:00
udf1 Varchar（2000）可选项udf1不得超过2000个字符
udf2 Varchar（2000）可选项udf2不得超过2000个字符
udf3 Varchar（50）可选
udf4 Varchar（50）可选
udf5 Varchar（50）可选
udf6 Varchar（50）可选
udf7 Varchar（50）可选
udf8 Varchar（50）可选
udf9 Varchar（50）可选
udf10 Varchar（50）可选
custtinno Varchar（20）可选客户识别号。
pickAfterDate datetime可选
cust_type varchar（5）可选可能值为B2B、B2C等，默认B2C
req_type Varchar（20）可选创建/更新，对于“创建”值，检查订单是否已存在
pickupLocation Varchar（255）可选订单应路由到此字段中传递的位置
handoverValCode Varchar（100）用于切换过程的可选切换验证代码
GeoType Varchar（50）可选Geocode系统类型（例如What3Words）。
GeoAddress Varchar（50）可选客户的收货地址
geoLatitude Varchar（50）可选地理代码纬度
geoLongitude Varchar（50）可选地理代码经度
orderProcessing Varchar（5）可选可能值为B2B、B2C等，默认B2C
lineno Varchar（255）外部系统的强制行号
sku Varchar（50）强制要求
channelSkuCode Varchar（50）可选外部系统SKU代码/市场SKU代码
channelProductId Varchar（50）在外部系统/市场中创建的SKU的可选ProductId
order_qty decimal（10.3）必填
cancelled_qty decimal（10,3）可选
unit_price 十进制（10,3）强制要求
bundle_sku Varchar（100）可选
bundle_price decimal（10,3）传递bundle_sku时条件强制
TEXT2;

$data=json_decode($str,1);
echo "/**\r\n";
zhiduan_text($dbname,"li_order,li_goods_sku,li_bill,li_order_item,li_member,li_member_address");
echo "\n**/\r\n\r\n//导入对接:\r\n";
$desc=description($description);
$settableKey="abc";
$searchRe=searchRe();
readK($data);


?>